Deployment Status Apache License Documentation Status Python Online Python version—Jan 27, 2021


Copyright © Wei MEI, MLMS™—all rights reserved. 🀤

Comments

Comments start with a hash character (#) and allow you to document your code. Comments are ignored when code is executed.

A comment starts with a hash character (#) that is not part of a string literal, and ends at the end of the physical line. A comment signifies the end of the logical line unless the implicit line joining rules are invoked. Comments are ignored by the syntax.

1
2
3
4
# This is a comment in my code it does nothing
# print('Hello world')
# print("Hello world")
# No output will be displayed!
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#The enable_pin method is not coded yet
# I have created a dummy method so the code
# will run without an error
# Don't panic if you don't understand this part of the code
# we cover methods in a separate module
def enable_pin(user, pin):
    print('pin enabled')

# Set current_user and pin to test values
current_user = 'TEST123'
pin = '123456'

# Enable PIN check as listed in
# security requirements
enable_pin(current_user, pin)

Challenges time

Check the following script and try to find the mistake:

1
2
print('Hello world')
print('It's a small world after all')

solutions:

1
2
3
# Using double quotes for this string because 
# the string itself contains a single quote
print("It's a small world after all")

How do we get started?

Now that we know about Python, the next question is, how do we get started? Well, the first thing that we’re going to need is somewhere for Python to run. Python is an interpreted language, so you will need a runtime in which Python can execute. Fortunately, all that you need to do is head on over to Python.org/downloads and you can go ahead and grab it from there.

PPT Demonstrations